from flask import Blueprint
from flask_cors import CORS
from flask_restful import Api

from routes.huiyan.ProjectController import ProjectController
from routes.huiyan.chat import chat
from routes.huiyan.chatAggregation import chatAggregation
from routes.huiyan.baiduOCR import baiduOCR
from routes.huiyan.baiduAPI import baiduAPI
from routes.huiyan.doc import doc
from routes.huiyan.file import DownloadFile, UploadFile, GetFile
from routes.huiyan.markdown_word import markdown_word
from routes.huiyan.generate_image import generate_image

blue_huiyan = Blueprint('blue_huiyan', __name__, url_prefix='/huiyan')
api = Api(blue_huiyan)
CORS(blue_huiyan)

api.add_resource(baiduOCR, '/baiduOCR/')
api.add_resource(baiduAPI, '/baiduAPI/')
api.add_resource(chat, '/chat/')
api.add_resource(chatAggregation, '/chatAggregation/')
api.add_resource(doc, '/doc/')
api.add_resource(markdown_word, '/markdown_word/')
api.add_resource(generate_image, '/generate_image/')

api.add_resource(DownloadFile, '/file/download/<name>')
api.add_resource(UploadFile, '/file/uploads/')
api.add_resource(GetFile, '/file/get_file/')
api.add_resource(ProjectController, '/project/')